package com.minshenglife.zanzan.pub.menubtn;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.nationsky.pub.utils.GsonUtils;

public class MenuBtn {
	
	public static final String CLICK="click";
	public static final String VIEW="view";
	
	String type;
	String name;
	String key;
	String url;
	List<MenuBtn> sub_button;
	
	public MenuBtn(String name,List<MenuBtn> sub_button){
		this.name=name;
		this.sub_button=sub_button;
	}
	
	public MenuBtn(String type,String name,String keyOrUrl){
		this.type=type;
		this.name=name;
		if(CLICK.equals(this.type))
			this.key=keyOrUrl;
		else if(VIEW.equals(this.type))
			this.url=keyOrUrl;
	}
	
	public String getType() {
		return type;
	}

	public void ListType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void ListName(String name) {
		this.name = name;
	}

	public String getKey() {
		return key;
	}

	public void ListKey(String key) {
		this.key = key;
	}

	public List<MenuBtn> getSub_button() {
		return sub_button;
	}

	public void ListSub_button(List<MenuBtn> sub_button) {
		this.sub_button = sub_button;
	}

	public String getUrl() {
		return url;
	}

	public void ListUrl(String url) {
		this.url = url;
	}

	public static void main(String[] sadf){
		
		Map<String,Object> map=new HashMap<String,Object>();
		List<Object> btnList=new ArrayList<Object>();
		List<MenuBtn> sub_btnList1=new ArrayList<MenuBtn>();
		List<MenuBtn> sub_btnList2=new ArrayList<MenuBtn>();
		List<MenuBtn> sub_btnList3=new ArrayList<MenuBtn>();
		btnList.add(new MenuBtn("���а�",sub_btnList1));
		btnList.add(new MenuBtn("��",sub_btnList2));
		btnList.add(new MenuBtn("���",sub_btnList3));
		
		sub_btnList1.add(new MenuBtn(MenuBtn.CLICK,"�컨��","ZZMSR_BTN_MENU_REDRANKING"));
		sub_btnList1.add(new MenuBtn(MenuBtn.CLICK,"�ͻ���","ZZMSR_BTN_MENU_SENDRANKING"));
		sub_btnList1.add(new MenuBtn(MenuBtn.CLICK,"���","ZZMSR_BTN_MENU_PROGRESSRANKING"));
		sub_btnList1.add(new MenuBtn(MenuBtn.CLICK,"��ְ�","ZZMSR_BTN_MENU_INTEGRALRANKING"));
		
		sub_btnList2.add(new MenuBtn(MenuBtn.CLICK,"�ҵĺ컨","ZZMSR_BTN_MENU_MYREDFLOWER"));
		sub_btnList2.add(new MenuBtn(MenuBtn.CLICK,"�ҵĻ��","ZZMSR_BTN_MENU_MYTEGRAL"));
		sub_btnList2.add(new MenuBtn(MenuBtn.CLICK,"�ҵ��²�","ZZMSR_BTN_MENU_MYTOCAO"));
		sub_btnList2.add(new MenuBtn(MenuBtn.CLICK,"�ҵ�����","ZZMSR_BTN_MENU_MYREVIEW"));
		sub_btnList2.add(new MenuBtn(MenuBtn.CLICK,"������Ϣ","ZZMSR_BTN_MENU_MYINFO"));
		
		sub_btnList3.add(new MenuBtn(MenuBtn.CLICK,"��Ϸ����","ZZMSR_BTN_MENU_GAME"));
		sub_btnList3.add(new MenuBtn(MenuBtn.CLICK,"�²۰�","ZZMSR_BTN_MENU_TUCAO"));
		sub_btnList3.add(new MenuBtn(MenuBtn.CLICK,"������","ZZMSR_BTN_MENU_NEWTHING"));
		sub_btnList3.add(new MenuBtn(MenuBtn.CLICK,"������","ZZMSR_BTN_MENU_HELPREPLAY"));
		
		map.put("button", btnList);
		
		String con=GsonUtils.toGson(map);
		System.out.println(con);
	}
}
